#include ".\mygamecusor.h"

CMyGameCusor::CMyGameCusor(void)
{
	m_MouseState = GMS_Normal;
	m_ptHotPoint.x = 0;
	m_ptHotPoint.y = 0;
}

CMyGameCusor::~CMyGameCusor(void)
{
}


void CMyGameCusor::Update()
{

}

void CMyGameCusor::Draw(HDC hDC)
{
	CMyGameWindow::Draw(hDC);
	int nDestX = m_ptScreenPos.x - m_ptHotPoint.x;
	int nDestY = m_ptScreenPos.y - m_ptHotPoint.y;
	int nSrcX = m_MouseState * m_sprMouseBmp.GetWidth() /4;
	int nScrY = 0;
	int nWith = m_sprMouseBmp.GetWidth() / 4;
	int nHeight = m_sprMouseBmp.GetHeight();
	m_sprMouseBmp.DrawRect(hDC,nDestX,nDestY,nSrcX,nScrY,nWith,nHeight,TRUE);
}

void CMyGameCusor::SetMouseState(GameMouseState MouseState)
{
	m_MouseState = MouseState;
}

GameMouseState CMyGameCusor::GetMouseState()
{
	return m_MouseState;
}

void CMyGameCusor::SetHotPoint(int x,int y)
{
	m_ptHotPoint.x = x;
	m_ptHotPoint.y = y;
}

POINT CMyGameCusor::GetHotPoint()
{
	return m_ptHotPoint;
}

void CMyGameCusor::LoadRes(LPCSTR szFileName)
{
	m_sprMouseBmp.Load(NULL,szFileName);
}